package com.example.demo.zhoushengwen.controller;

import com.example.demo.zhoushengwen.service.ExceptionTestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//预知异常测试地址:  localhost:8080/expection/test
@RestController
@RequestMapping("/expection")
public class ExceptionController {
    @Autowired
    private ExceptionTestService exceptionTestService;

    @GetMapping("/test")
    public void testException() {
        exceptionTestService.testException();
    }

    @GetMapping("/cannotForesee")
    public void cannotForesee() {
        int a = 1 / 0;
    }

}
